package BusinessLogic;

import java.util.HashMap;
import java.util.Map;

public class Session implements Comparable<Session>{
  
  private String course;
  private String day;
  private int start_time;
  private int end_time;
  
  public static final Map<String,Integer> days;
  static {
	  days = new HashMap<String, Integer>();
      days.put("Sunday", 1);
      days.put("Monday", 2);
      days.put("Tuesday", 3);
      days.put("Wednesday", 4);
      days.put("Thursday", 5);
      days.put("Friday", 6);
      days.put("Saturday", 7);
  }
  public Session(String course, String day, int start_time, int end_time) { 
    super();
    this.course = course;
    this.day = day;
    this.start_time = start_time;
    this.end_time = end_time;
  }

  public String getCourse() {
    return course;
  }

  public void setCourse(String course) {
    this.course = course;
  }

  public String getDay() {
    return day;
  }

  public void setDay(String day) {
    this.day = day;
  }

  public int getStart_time() {
    return start_time;
  }

  public void setStart_time(int start_time) {
    this.start_time = start_time;
  }

  public int getEnd_time() {
    return end_time;
  }

  public void setEnd_time(int end_time) {
    this.end_time = end_time;
  }

@Override
public int compareTo(Session to) {
	if ((days.get(this.day)).compareTo(days.get(to.day)) != 0)
		return (days.get(this.day)).compareTo(days.get(to.day));
	return new Integer(this.start_time).compareTo(new Integer(to.start_time));
}
  
  
}
